package group9;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * @author Claudio Herreros, Dylan James, Tyler Berg
 *
 */

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Estimate {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Integer value;
	@Persistent
	private UserStory userStory;
	@Persistent
	private Key user;
	
	public Estimate(Integer value, UserStory userStory, Key user)
	{
		this.value = value;
		this.userStory = userStory;
		this.user = user;
	}
	
	public Estimate(Integer value, UserStory userStory, User user)
	{
		this(value, userStory, user.getKey());
	}
	
	public int getValue()
	{
		return this.value;
	}
	
	public void setValue(Integer value)
	{
		this.value = value;
	}
	
	public Key getUserKey()
	{
		return this.user;
	}
}
